<?
/**
 * Source database object
 */
class Source extends SourceDbo {

/**
 * constructer
 */
public function __construct() {
	parent::__construct();
	}

/**
 * Getters
 */
public function Id() {
	return $this->getProperty('Id');
	}
public function Source() {
	return $this->getProperty('Source');
	}

/**
 * Can the currently populated item be deleted?
 * @return bool
 */
public function canDelete() {
	return ($this->populated);
	}

/**
 * Delete currently populated object, taking care of linked objects first.
 * @return bool true on success
 * @return string error message on failures.
 */
public function delete() {
	if (!$this->canDelete()) {
		return 'Item cannot be deleted at this time.';
		}
	return parent::delete();
	}

/**
 * Obtain standardized object list.
 * @return array
 */
public function getList() {
	$this->searchReset();
	$this->setSearchSelect('Id');
	$this->setSearchSelect('Source');
	$this->setSearchOrder('Source');
	return $this->query();
	}

/**
 * Overload the validation method.
 * @param bool skipId = skip validation of id property
 * @return bool true on success
 * @return string error message on failures.
 */
public function validate($skipId = false) {
	$rc = parent::validate($skipId);
	if (!($rc === true)) { return $rc; }

	// These properties are required.
	$props = array('Source');
	foreach($props as &$prop) {
		if (!$this->validateString($this->getProperty($prop))) {
			return 'Must specify ' . $this->getPropertyDescription($prop);
			}
		}
	return true;
	}

}
?>
